﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Draco.OWF.Transition
{
    public abstract class AbstractRoute:IRoute
    {
        protected String m_Id = Guid.NewGuid().ToString();
        protected String m_FromId;
        protected String m_ToId;

        public AbstractRoute(String fromId, String toId)
            : this("", fromId, toId){}
        public AbstractRoute(String id,String fromId,String toId)
        {
            if (String.IsNullOrEmpty(fromId))
                throw new ArgumentNullException("argument fromId is empty");
            if (String.IsNullOrEmpty(toId))
                throw new ArgumentNullException("argument toId is empty");
            this.Id = id;
            this.m_FromId = fromId;
            this.m_ToId = toId;
        }

        public virtual string Id
        {
            get{return m_Id;}
            set
            {
                if (!String.IsNullOrEmpty(value))
                    m_Id = value;
            }
        }

        public virtual string FromId
        {
            get { return m_FromId; }
        }

        public virtual string ToId
        {
            get { return m_ToId; }
        }

        public abstract String TransitionType { get; }
    }
}
